package com.chixing.Homework;

public class Account {
    public  long accNo;
    public String accName;
    private long accTelno;
    private long accPassword;
    private String  accEmail;
    private double accBalance;
    private int accType;


    public Account(long no,String name,long tel,long pwd,String email,double bal,int type){

        this.accNo=no;
        this.accName=name;
        this.accTelno=tel;
        this.accPassword=pwd;
        this.accEmail=email;
        this.accBalance=bal;
        this.accType=type;
        System.out.println("账号：" + no + " 账户名：" + name + " 电话：" + tel + " 密码：" + pwd + " 邮箱：" + email + " 余额：" + bal + " 账户类型：" + tel );


    }
    //存款
    public double depoist(double money){

        double total =accBalance +money;
        System.out.println("您的总余额为：" + total);

        return total;
    }

    //取款
    public boolean withdraw(double money){
        if (accBalance>money) {
            accBalance-=money;
            return true;
        }
        else {
            System.out.println("您所取金额超过了卡内余额!");
            return false;
        }

    }

    public long getAccNo() {
        return accNo;
    }

    public void setAccNo(long accNo) {
        this.accNo = accNo;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public long getAccTelno() {
        return accTelno;
    }

    public void setAccTelno(long accTelno) {
        this.accTelno = accTelno;
    }

    public long getAccPassword() {
        return accPassword;
    }

    public void setAccPassword(long accPassword) {
        this.accPassword = accPassword;
    }

    public String getAccEmail() {
        return accEmail;
    }

    public void setAccEmail(String accEmail) {
        this.accEmail = accEmail;
    }

    public double getAccBalance() {
        return accBalance;
    }

    public void setAccBalance(double accBalance) {
        this.accBalance = accBalance;
    }

    public int getAccType() {
        return accType;
    }

    public void setAccType(int accType) {
        this.accType = accType;
    }

    //    alt+insert tostring()
//    @Override
//    public String toString() {
//        return "Account{" +
//                "accNo=" + accNo +
//                ", accName='" + accName + '\'' +
//                ", accTelno=" + accTelno +
//                ", accPassword=" + accPassword +
//                ", accEmail='" + accEmail + '\'' +
//                ", accBalance=" + accBalance +
//                ", accType=" + accType +
//                '}';
//    }
}
